<div id="content">
	<div class="row s_page_title">
		<sa-big-breadcrumbs [items]="['日志信息管理','设备状态检测']" icon="fa fa-tag" class="col-xs-12 col-sm-7 col-md-7 col-lg-4"></sa-big-breadcrumbs>
	</div>
	<sa-widgets-grid>
		<div class="s_table">
			<div sa-widget [editbutton]="false" color="darken" class="clearfix">
				<header><span class="widget-icon"> <i class="fa fa-table"></i> </span><h2>设备状态检测</h2></header>
				<div>
					<div class="widget-body no-padding">
						<div class="page-header clearfix s_table_opreation">
							<div class="left page-header-btn">
								<div class="top_module top_module_box">
									<span class="module_text">车牌号码</span>
									<div class="s_hover_box">
										<select   class="select2"  id="carNumberSelect2">
											<option value=''></option>
										</select>
										<div class="s_del_icon" (click)='del_carNumber()'>x</div>
									</div>
								</div>
								<div class="top_module">
									<span class="module_text">接口使用类型</span>
									<select name="type" id="" class="module_inp" [(ngModel)]="useType">
										<option value="">全部</option>
										<option value="1">进厂判断</option>
										<option value="2">设备检测</option>
									</select>
								</div>
								<div class="top_module">
									<span class="module_text">状态类型</span>
									<select name="type" id="" class="module_inp" [(ngModel)]="type">
										<option value="">全部</option>
										<option value="0">无警报</option>
										<option value="1">断电警报</option>
										<option value="2">离线警报</option>
										<option value="3">数据异常</option>
										<option value="4">主机异常</option>
										<option value="5">GPS异常</option>
										<option value="6">传感器异常</option>
										<option value="7">设备离线</option>
										<option value="99">服务到期</option>
									</select>
								</div>
								<div class="selectDate top_module">
									<table-select-date [notInit]='false' (outerTime)="getSelectTableTime($event)" ></table-select-date>
								</div>
								
								<button type="button" class="btn btn-primary" (click)="search_data()">查询</button>
								<button type="button" class="btn btn-primary" (click)="exportData()">导出</button>
							</div>
							<div class="right top-search">
								<input class="search-input"[(ngModel)]='searchKey' (change)="table_search()" placeholder="车牌号,用户..." type="text">
								<span class="top-search-box">
							        <button class="top-search-btn" (click)="table_search()" type="button"> <i class="fa fa-search"></i></button>
							    </span>
							</div>
						</div>
						<div class="table_scroll">
							<table class="display dataTables responsive table table-striped table-bordered table-hover dataTable s_h5_table">
								<thead>
									<tr>
										<th>用户名称</th>
										<th>接口使用类型</th>
										<th>设备ID</th>
										<th>车牌号码</th>
										<th>状态类型</th>
										<th>操作内容</th>
										<th>IP地址</th>
										<th>调用接口消耗时间[毫秒]</th>
										<th>创建时间</th>
									</tr>
								</thead>
								<tbody>
									<tr *ngFor="let row of resultTableData" >
										<td>{{row.userName}}</td>
										<td>
											<span *ngIf="row.useType == 1">进厂判断</span>
											<span *ngIf="row.useType == 2">设备检测</span>
										</td>
										<td>{{row.deviceId}}</td>
										<td>{{row.carNumber}}</td>
										<td>
											<span *ngIf='row.type == 0'>无警报</span>
											<span *ngIf='row.type == 1'>断电警报</span>
											<span *ngIf='row.type == 2'>离线警报</span>
											<span *ngIf='row.type == 3'>数据异常</span>
											<span *ngIf='row.type == 4'>主机异常</span>
											<span *ngIf='row.type == 5'>GPS异常</span>
											<span *ngIf='row.type == 6'>传感器异常</span>
											<span *ngIf='row.type == 7'>设备离线</span>
											<span *ngIf='row.type == 99'>服务到期</span>
										</td>
										<td>{{row.remark}}</td>
										<td>{{row.ip}}</td>
										<td>{{row.spentTime}}</td>
										<td>{{row.createTime}}</td>
									</tr>
								</tbody>
							</table>
						</div>
						<div class="table-fix clearfix">
							<paginator [totalRecords]="totalCount"
						           [rows]="pageSize"
						           [currentPage]="curPage - 1"
						           (onPageChange)="paginate($event)">
							</paginator>
							<button type="button" class="btn default refresh_btn" (click)="refresh()"><i class="fa fa-refresh"></i></button>
						</div>
					</div>
				</div>
			</div>
		</div>
	</sa-widgets-grid>
</div>